home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / xcmd / sprtxtrn.sea / Support Tools eXternals 1.2.5 / card_37750.txt < prev    next >
Text File  |  1990-11-13  |  4KB  |  118 lines

  1. -- card: 37750 from stack: in.5
  2. -- bmap block id: 43331
  3. -- flags: 0000
  4. -- background id: 3858
  5. -- name: MonitorConfig
  6. ----- HyperTalk script -----
  7. on CloseCard
  8.   put empty into cd fld "monitor list"
  9.   set the scroll of cd fld "monitor list" to 0
  10.   pass CloseCard
  11. end CloseCard
  12.  
  13. on HideObjects
  14.   hide cd fld "monitor list"
  15.   hide cd btn "all monitors"
  16.   hide cd btn "cardwindow"
  17. end HideObjects
  18.  
  19. on ShowObjects
  20.   show cd fld "monitor list"
  21.   show cd btn "all monitors"
  22.   show cd btn "cardwindow"
  23. end ShowObjects
  24.  
  25.  
  26. -- part 1 (field)
  27. -- low flags: 00
  28. -- high flags: 0007
  29. -- rect: left=19 top=117 right=288 bottom=236
  30. -- title width / last selected line: 0
  31. -- icon id / first selected line: 0 / 0
  32. -- text alignment: 0
  33. -- font id: 4
  34. -- text size: 9
  35. -- style flags: 0
  36. -- line height: 12
  37. -- part name: Monitor list
  38.  
  39.  
  40. -- part 2 (button)
  41. -- low flags: 00
  42. -- high flags: A002
  43. -- rect: left=27 top=292 right=326 bottom=120
  44. -- title width / last selected line: 0
  45. -- icon id / first selected line: 0 / 0
  46. -- text alignment: 1
  47. -- font id: 0
  48. -- text size: 12
  49. -- style flags: 8192
  50. -- line height: 16
  51. -- part name: All monitors
  52. ----- HyperTalk script -----
  53. on mouseUp
  54.   global errGlobal
  55.   put empty into cd fld "monitor list"
  56.   repeat with monitorNdx = 1 to MonitorCount()
  57.     put MonitorConfig(monitorNdx, "noDialog:errGlobal") into theConfig
  58.     if errGlobal Γëá empty then
  59.       answer "Error:" && errGlobal
  60.       put empty into errGlobal
  61.     else
  62.       put theConfig & return after cd fld "monitor list"
  63.     end if
  64.   end repeat
  65. end mouseUp
  66.  
  67.  
  68.  
  69.  
  70. -- part 3 (button)
  71. -- low flags: 00
  72. -- high flags: A002
  73. -- rect: left=132 top=292 right=326 bottom=225
  74. -- title width / last selected line: 0
  75. -- icon id / first selected line: 0 / 0
  76. -- text alignment: 1
  77. -- font id: 0
  78. -- text size: 12
  79. -- style flags: 8192
  80. -- line height: 16
  81. -- part name: CardWindow
  82. ----- HyperTalk script -----
  83. on mouseUp
  84.   global errGlobal
  85.   put MonitorConfig("CardWindow", "noDialog:errGlobal") into theConfig
  86.   if errGlobal Γëá empty then
  87.     answer "Error: ΓÇ£" & errGlobal & "ΓÇ¥"
  88.     put empty into errGlobal
  89.   else
  90.     put theConfig into cd fld "monitor list"
  91.   end if
  92. end mouseUp
  93.  
  94.  
  95.  
  96.  
  97. -- part contents for background part 38
  98. ----- text -----
  99. 31/50
  100.  
  101. -- part contents for background part 20
  102. ----- text -----
  103.      An XFCN which returns the current  configuration of the Mac's monitor(s).   The information returned for each monitor is:
  104.    Line 1 - absolute global coordinates of the monitor.   The point 0,0 in this world is the upper left corner of the menu bar.
  105.     Line 2 - horizontal and vertical size of the monitor (in pixels).
  106.     Line 3 - NuBus slot number of the monitor's video card.  Numbers start at 1 (slot nearest the power supply).
  107.     Line 4 - current bit depth and color setting.
  108.     Line 5 - "Active" if the monitor it has been activated from the Monitors cdev , or "Inactive" if it is inactive.
  109.      Line 6 - "Has menu bar" if the monitor contains the menu bar, empty if not. 
  110.  
  111.      Calling syntax : monitorConfig(monitorNum or ΓÇ£CardWindowΓÇ¥,<ΓÇ£noDialogΓÇ¥:errorGlobal> )
  112.   MONITORNUM: which monitor to check (monitor #1 is the boot monitor ie. it shows the "smiley mac" on bootup or when holding the option key down while in the 'Monitors' CDEV).
  113.   CARDWINDOW: report on the monitor containing the HyperCard window.  
  114.  
  115. NOTE - the XFCN uses the middle of the card window as it's location.  If that point is offscreen it checks the following points (in order) until it finds one which is onscreen: middle of the window's title bar, upper right corner of the window's title bar, and upper left of the window's title bar.
  116.  
  117.  
  118.